package com.dnndo.web.controller.system;

import com.dnndo.common.core.controller.BaseController;
import com.dnndo.common.core.domain.AjaxResult;
import com.dnndo.common.utils.bean.BeanDtoVoUtil;
import com.dnndo.system.domain.SchBrandRoom;
import com.dnndo.system.domain.vo.SchBrandRoomVo;
import com.dnndo.system.service.ISchBrandRoomService;
import com.dnndo.system.service.ISchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/schBrandRoom")
public class SchBrandRoomController extends BaseController {

  private final ISchoolService schoolService;
  private final ISchBrandRoomService schBrandRoomService;

  @Autowired
  public SchBrandRoomController(ISchoolService schoolService, ISchBrandRoomService schBrandRoomService) {
    this.schoolService = schoolService;
    this.schBrandRoomService = schBrandRoomService;
  }
  /**
   * 根据学校id查询校园品牌馆
   * @param id 学校id
   * @return 对应id校园品牌馆信息
   */
  @GetMapping( "/list/{id}")
  public AjaxResult getInfo(@PathVariable("id") Integer id)
  {
    SchBrandRoom schBrandRoom = schBrandRoomService.getschBrandRoom(id);
    SchBrandRoomVo SchBrandRoomVO = BeanDtoVoUtil.convert(schBrandRoom, SchBrandRoomVo.class);
    return AjaxResult.success(SchBrandRoomVO);
  }
}
